#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
	int n, m;
	cin >> n >> m;

	int ans1, ans2;
	ans1 = ans2 = 0;
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= m; j++) {
			if (i == j)
				ans1 += ceil(1.0 * n * m / i / j);
			else
				ans2 += ceil(1.0 * n * m / i / j);
		}
	}
	cout << ans1 << " " << ans2;
	return 0;
}
